package jsyf.oa.entity.doc;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * Created by Administrator on 2018/4/20.
 */
@Entity
@Table(name = "T_DOC_TYPE", schema = "oa", catalog = "")
public class TypeEntity extends BaseEntity implements Serializable {

    private String name;
    private String url;
    private Integer delFlag;
    private Integer sortNo;

    @Override
    public String getId() {
        return id;
    }

    @Override
    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public Integer getDelFlag() {
        return delFlag;
    }

    @Override
    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    public Integer getSortNo() {
        return sortNo;
    }

    public void setSortNo(Integer sortNo) {
        this.sortNo = sortNo;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID",getId());
        obj.put("NAME",getName());
        obj.put("URL",getUrl());
        obj.put("DEL_FLAG",getDelFlag());
        obj.put("SORT_NO",getSortNo());
        return  obj;
    }

    @Override
    public String getTableName() {
        return "t_doc_type";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("NAME", "name");
        obj.put("URL", "url");
        obj.put("DEL_FLAG", "delFlag");
        obj.put("SORT_NO","sortNo");
        return obj;
    }
}